#include <signal.h>
#include "log.h"

extern int current_socket;

//when write disconnect socket
void sigpipe_handle(int sig) {
    DBG("Received SIGPIPE signal\n");
    close(current_socket);
}


void error_handle_init() {
    signal(SIGPIPE, sigpipe_handle);
}